<?php

class Nimblecms_Auth_Acl extends Zend_Acl {
	public function __construct() {

		$this->addRole(new Zend_Acl_Role('guest'));
		
		$this->addRole(new Zend_Acl_Role('member'), 'guest');
		
		$this->addRole(new Zend_Acl_Role('administrator'));
		
		$this->addResource('default_index');
		$this->addResource('users_index');
		$this->addResource('default_dashboard');
		
		
		$this->allow('guest', array('default_index'));
		$this->allow('guest', 'users_index', array('register','login','password'));
		
		$this->deny('member', 'users_index', array('register','login', 'password'));
		
		$this->allow('member', 'users_index', array('logout','index','photo','profile','user','sendmessage','changepwd'));
		
		$this->allow('administrator');
		
		$this->deny('administrator', 'users_index', array('register','login', 'password'));
		
		return $this;
	}
}